package com.lemonfish.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;

/**
 * 角色 Entity定义
 *
 * @author Lemonfish
 * @version 1.0
 * @date 2020-03-02
 * Copyright © ï¿½Å³ï¿½
 */
@ApiModel(value = "角色")
@Accessors(chain = true)
@Getter
@ToString
@Setter
public class Role extends BaseCustomEntity {

    private static final long serialVersionUID = -6412068065198321L;

    // 角色名
    @ApiModelProperty(value = "角色名", required = true, example = "VIP1")
    @NotNull(message = "角色名不能为空")
    @Length(max = 10, message = "角色名长度应小于10")
    @TableField()
    private String name;

    // 角色作用
    @ApiModelProperty(value = "角色作用", example = "管理数据")
    @Length(max = 100, message = "角色作用长度应小于100")
    @TableField()
    private String func;
}
